# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=rttr
pkgver=0.9.6
pkgrel=2
pkgdesc="C++ Reflection library"
arch="all"
url="https://www.rttr.org/"
license="MIT"
makedepends="cmake doxygen graphviz"
source="https://www.rttr.org/releases/rttr-$pkgver-src.tar.gz
	permission.patch
	"
subpackages="$pkgname-dev $pkgname-doc"
options="!check" # Broken

build() {
	cmake \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_UNIT_TESTS=FALSE \
		-DBUILD_EXAMPLES=OFF
	make
}

check() {
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" make install

	install -d "$pkgdir"/usr/share
	mv "$pkgdir"/usr/doc "$pkgdir"/usr/share/doc
}
sha512sums="7e0d4fa87f83feda0b926d4d0e52aaf0f369f25fe7e23e5ffe86c0bba159e8353cef44eed37611a81e8ccc8d6facb36942f940d0d0b965f873177d7078f91cf4  rttr-0.9.6-src.tar.gz
5bd959bf2741739aa34732768d78e2fd7694278e04cde0eba5e2b2fe8817910e1727834f60b8114edc77100f5dbf3059ccb882553dfa7484218fc5d9fb3cdbe5  permission.patch"
